package com.engine4cloud.tdf.supervision.controller.web;

import com.engine4cloud.tdf.common.core.util.R;
import com.engine4cloud.tdf.common.data.web.response.PageInfo;
import com.engine4cloud.tdf.common.data.web.response.Params;
import com.engine4cloud.tdf.supervision.dto.query.GzryStaffQueryDTO;
import com.engine4cloud.tdf.supervision.dto.result.GzryStaffResultDTO;
import com.engine4cloud.tdf.supervision.service.GzryStaffService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springdoc.core.annotations.ParameterObject;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * staff
 *
 * @author wenjie
 * @date 2024-04-15 11:36:11
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/web/staff")
@Tag(description = "staff", name = "工作人员-查询-web")
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
public class GzryStaffWebController {

    @Resource
    private GzryStaffService staffService;

    /**
     * 分页查询
     *
     * @param page 分页对象
     * @param dto  社区志愿者
     * @return R<PageInfo < GzryVolunteerResultDTO>>
     */
    @Operation(summary = "分页查询", description = "分页查询")
    @GetMapping("/page")
    public R<PageInfo<GzryStaffResultDTO>> getPageList(@ParameterObject Params page, @Valid @ParameterObject GzryStaffQueryDTO dto) {
        return R.ok(staffService.getPageList(page, dto));
    }
}